home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / necko / nsIDownloader.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  6KB  |  191 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIDownloader.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIDownloader_h__
  6. #define __gen_nsIDownloader_h__
  7.  
  8.  
  9. #ifndef __gen_nsIStreamListener_h__
  10. #include "nsIStreamListener.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsIFile; /* forward declaration */
  18.  
  19. class nsIDownloadObserver; /* forward declaration */
  20.  
  21.  
  22. /* starting interface:    nsIDownloader */
  23. #define NS_IDOWNLOADER_IID_STR "fafe41a9-a531-4d6d-89bc-588a6522fb4e"
  24.  
  25. #define NS_IDOWNLOADER_IID \
  26.   {0xfafe41a9, 0xa531, 0x4d6d, \
  27.     { 0x89, 0xbc, 0x58, 0x8a, 0x65, 0x22, 0xfb, 0x4e }}
  28.  
  29. /**
  30.  * nsIDownloader
  31.  *
  32.  * A downloader is a special implementation of a nsIStreamListener that will
  33.  * make the contents of the stream available as a file.  This may utilize the
  34.  * disk cache as an optimization to avoid an extra copy of the data on disk.
  35.  * The resulting file is valid from the time the downloader completes until
  36.  * the last reference to the downloader is released.
  37.  */
  38. class NS_NO_VTABLE nsIDownloader : public nsIStreamListener {
  39.  public: 
  40.  
  41.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IDOWNLOADER_IID)
  42.  
  43.   /**
  44.      * Initialize this downloader
  45.      *
  46.      * @param observer
  47.      *        the observer to be notified when the download completes.
  48.      * @param downloadLocation
  49.      *        the location where the stream contents should be written.
  50.      *        if null, the downloader will select a location and the
  51.      *        resulting file will be deleted (or otherwise made invalid)
  52.      *        when the downloader object is destroyed.  if an explicit
  53.      *        download location is specified then the resulting file will
  54.      *        not be deleted, and it will be the callers responsibility
  55.      *        to keep track of the file, etc.
  56.      */
  57.   /* void init (in nsIDownloadObserver observer, in nsIFile downloadLocation); */
  58.   NS_IMETHOD Init(nsIDownloadObserver *observer, nsIFile *downloadLocation) = 0;
  59.  
  60. };
  61.  
  62. /* Use this macro when declaring classes that implement this interface. */
  63. #define NS_DECL_NSIDOWNLOADER \
  64.   NS_IMETHOD Init(nsIDownloadObserver *observer, nsIFile *downloadLocation); 
  65.  
  66. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  67. #define NS_FORWARD_NSIDOWNLOADER(_to) \
  68.   NS_IMETHOD Init(nsIDownloadObserver *observer, nsIFile *downloadLocation) { return _to Init(observer, downloadLocation); } 
  69.  
  70. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  71. #define NS_FORWARD_SAFE_NSIDOWNLOADER(_to) \
  72.   NS_IMETHOD Init(nsIDownloadObserver *observer, nsIFile *downloadLocation) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(observer, downloadLocation); } 
  73.  
  74. #if 0
  75. /* Use the code below as a template for the implementation class for this interface. */
  76.  
  77. /* Header file */
  78. class nsDownloader : public nsIDownloader
  79. {
  80. public:
  81.   NS_DECL_ISUPPORTS
  82.   NS_DECL_NSIDOWNLOADER
  83.  
  84.   nsDownloader();
  85.  
  86. private:
  87.   ~nsDownloader();
  88.  
  89. protected:
  90.   /* additional members */
  91. };
  92.  
  93. /* Implementation file */
  94. NS_IMPL_ISUPPORTS1(nsDownloader, nsIDownloader)
  95.  
  96. nsDownloader::nsDownloader()
  97. {
  98.   /* member initializers and constructor code */
  99. }
  100.  
  101. nsDownloader::~nsDownloader()
  102. {
  103.   /* destructor code */
  104. }
  105.  
  106. /* void init (in nsIDownloadObserver observer, in nsIFile downloadLocation); */
  107. NS_IMETHODIMP nsDownloader::Init(nsIDownloadObserver *observer, nsIFile *downloadLocation)
  108. {
  109.     return NS_ERROR_NOT_IMPLEMENTED;
  110. }
  111.  
  112. /* End of implementation class template. */
  113. #endif
  114.  
  115.  
  116. /* starting interface:    nsIDownloadObserver */
  117. #define NS_IDOWNLOADOBSERVER_IID_STR "44b3153e-a54e-4077-a527-b0325e40924e"
  118.  
  119. #define NS_IDOWNLOADOBSERVER_IID \
  120.   {0x44b3153e, 0xa54e, 0x4077, \
  121.     { 0xa5, 0x27, 0xb0, 0x32, 0x5e, 0x40, 0x92, 0x4e }}
  122.  
  123. class NS_NO_VTABLE nsIDownloadObserver : public nsISupports {
  124.  public: 
  125.  
  126.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IDOWNLOADOBSERVER_IID)
  127.  
  128.   /**
  129.      * Called to signal a download that has completed.
  130.      */
  131.   /* void onDownloadComplete (in nsIDownloader downloader, in nsIRequest request, in nsISupports ctxt, in nsresult status, in nsIFile result); */
  132.   NS_IMETHOD OnDownloadComplete(nsIDownloader *downloader, nsIRequest *request, nsISupports *ctxt, nsresult status, nsIFile *result) = 0;
  133.  
  134. };
  135.  
  136. /* Use this macro when declaring classes that implement this interface. */
  137. #define NS_DECL_NSIDOWNLOADOBSERVER \
  138.   NS_IMETHOD OnDownloadComplete(nsIDownloader *downloader, nsIRequest *request, nsISupports *ctxt, nsresult status, nsIFile *result); 
  139.  
  140. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  141. #define NS_FORWARD_NSIDOWNLOADOBSERVER(_to) \
  142.   NS_IMETHOD OnDownloadComplete(nsIDownloader *downloader, nsIRequest *request, nsISupports *ctxt, nsresult status, nsIFile *result) { return _to OnDownloadComplete(downloader, request, ctxt, status, result); } 
  143.  
  144. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  145. #define NS_FORWARD_SAFE_NSIDOWNLOADOBSERVER(_to) \
  146.   NS_IMETHOD OnDownloadComplete(nsIDownloader *downloader, nsIRequest *request, nsISupports *ctxt, nsresult status, nsIFile *result) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnDownloadComplete(downloader, request, ctxt, status, result); } 
  147.  
  148. #if 0
  149. /* Use the code below as a template for the implementation class for this interface. */
  150.  
  151. /* Header file */
  152. class nsDownloadObserver : public nsIDownloadObserver
  153. {
  154. public:
  155.   NS_DECL_ISUPPORTS
  156.   NS_DECL_NSIDOWNLOADOBSERVER
  157.  
  158.   nsDownloadObserver();
  159.  
  160. private:
  161.   ~nsDownloadObserver();
  162.  
  163. protected:
  164.   /* additional members */
  165. };
  166.  
  167. /* Implementation file */
  168. NS_IMPL_ISUPPORTS1(nsDownloadObserver, nsIDownloadObserver)
  169.  
  170. nsDownloadObserver::nsDownloadObserver()
  171. {
  172.   /* member initializers and constructor code */
  173. }
  174.  
  175. nsDownloadObserver::~nsDownloadObserver()
  176. {
  177.   /* destructor code */
  178. }
  179.  
  180. /* void onDownloadComplete (in nsIDownloader downloader, in nsIRequest request, in nsISupports ctxt, in nsresult status, in nsIFile result); */
  181. NS_IMETHODIMP nsDownloadObserver::OnDownloadComplete(nsIDownloader *downloader, nsIRequest *request, nsISupports *ctxt, nsresult status, nsIFile *result)
  182. {
  183.     return NS_ERROR_NOT_IMPLEMENTED;
  184. }
  185.  
  186. /* End of implementation class template. */
  187. #endif
  188.  
  189.  
  190. #endif /* __gen_nsIDownloader_h__ */
  191.